/* 全局样式 */
:root {
  --primary-color: #ff4d4f;
  --secondary-color: #1890ff;
  --dark-color: #141414;
  --light-color: #f5f5f5;
  --text-color: #ffffff;
  --hover-color: #ff7875;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Microsoft YaHei', sans-serif;
  background-color: var(--dark-color);
  color: var(--text-color);
  line-height: 1.6;
  padding-bottom: 80px; /* 为底部导航栏留出空间 */
}

a {
  color: var(--text-color);
  text-decoration: none;
}

ul {
  list-style: none;
}

img {
  max-width: 100%;
  height: auto;
}

button {
  border: none;
  background: none;
  cursor: pointer;
  outline: none;
}

/* 头部导航栏 */
.header {
  background-color: rgba(20, 20, 20, 0.9);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px;
}

.logo img {
  height: 40px;
}

.search-box {
  display: flex;
  align-items: center;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 5px 15px;
  flex: 1;
  margin: 0 15px;
  max-width: 300px;
}

.search-box input {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-color);
  outline: none;
  font-size: 14px;
}

.search-box input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.search-btn {
  color: rgba(255, 255, 255, 0.7);
  font-size: 16px;
}

.user-menu {
  display: flex;
  gap: 10px;
}

.login-btn,
.register-btn {
  background-color: var(--primary-color);
  color: var(--text-color);
  padding: 8px 15px;
  border-radius: 20px;
  font-size: 14px;
  transition: background-color 0.3s ease;
}

.login-btn:hover,
.register-btn:hover {
  background-color: var(--hover-color);
}

/* 底部导航栏 */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: rgba(20, 20, 20, 0.9);
  backdrop-filter: blur(10px);
  display: flex;
  justify-content: space-around;
  padding: 10px 0;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.5);
  z-index: 100;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: rgba(255, 255, 255, 0.7);
  transition: color 0.3s ease;
}

.nav-item.active {
  color: var(--primary-color);
}

.nav-item i {
  font-size: 20px;
  margin-bottom: 5px;
}

.nav-item span {
  font-size: 12px;
}

/* 主内容区 */
.main-content {
  padding: 15px;
}

.section-title {
  font-size: 18px;
  margin-bottom: 15px;
  font-weight: bold;
  position: relative;
  padding-left: 10px;
}

.section-title::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 18px;
  background-color: var(--primary-color);
  border-radius: 3px;
}

/* 轮播图 */
.hero-slider {
  margin-bottom: 30px;
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.slider-container {
  display: flex;
  transition: transform 3s ease;
}

.slide {
  min-width: 100%;
  position: relative;
}

.slide img {
  width: 33.3%;
  height: 200px;
  object-fit: cover;
}

.slide-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0));
  padding: 20px;
}

.slide-content h3 {
  font-size: 18px;
  margin-bottom: 5px;
}

.slide-content p {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 10px;
}

.play-btn {
  background-color: var(--primary-color);
  color: var(--text-color);
  padding: 8px 15px;
  border-radius: 20px;
  font-size: 14px;
  display: flex;
  align-items: center;
  transition: background-color 0.3s ease;
}

.play-btn:hover {
  background-color: var(--hover-color);
}

.play-btn i {
  margin-right: 5px;
}

.slider-dots {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 5px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.dot.active {
  background-color: var(--primary-color);
}

/* 轮播图左右按钮样式 */
.slider-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  background-color: rgba(0, 0, 0, 0.5);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  color: #fff;
  z-index: 10;
  transition: background-color 0.3s ease;
}

.slider-btn:hover {
  background-color: var(--primary-color);
}

.prev-btn {
  left: 10px;
}

.next-btn {
  right: 10px;
}

/* 游戏分类 */
.game-categories {
  margin-bottom: 30px;
}

.category-container {
  display: flex;
  gap: 15px;
  overflow-x: auto;
  padding-bottom: 10px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.category-container::-webkit-scrollbar {
  display: none;
}

.category-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 80px;
  transition: transform 0.3s ease;
}

.category-item:hover {
  transform: translateY(-5px);
}

.category-item img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 50%;
  margin-bottom: 5px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.category-item span {
  font-size: 14px;
}

/* 最新CG */
.latest-cg {
  margin-bottom: 30px;
}

.cg-container {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
}

.cg-item {
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
}

.cg-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.video-thumb {
  position: relative;
}

.video-thumb img {
  width: 100%;
  height: 120px;
  object-fit: cover;
}

.duration {
  position: absolute;
  bottom: 5px;
  right: 5px;
  background-color: rgba(0, 0, 0, 0.7);
  color: var(--text-color);
  font-size: 12px;
  padding: 2px 5px;
  border-radius: 5px;
}

.cg-item h3 {
  font-size: 14px;
  padding: 8px 10px 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cg-item p {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
  padding: 0 10px 10px;
}

/* 热门赛事 */
.hot-events {
  margin-bottom: 30px;
}

.event-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 15px;
}

.event-item {
  display: flex;
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.event-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.event-item img {
  width: 120px;
  height: 100%;
  object-fit: cover;
}

.event-info {
  flex: 1;
  padding: 10px 15px;
}

.event-info h3 {
  font-size: 16px;
  margin-bottom: 5px;
}

.event-info p {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 5px;
}

.date {
  font-size: 12px;
  color: var(--secondary-color);
}

/* 模态框 */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 200;
  justify-content: center;
  align-items: center;
  padding: 15px;
}

.modal.active {
  display: flex;
}

.modal-content {
  background-color: var(--dark-color);
  border-radius: 10px;
  width: 100%;
  max-width: 400px;
  overflow: hidden;
  animation: fadeIn 0.3s ease;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.video-content {
  max-width: 800px;
  width: 100%;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header h2 {
  font-size: 18px;
}

.close-modal {
  color: rgba(255, 255, 255, 0.7);
  font-size: 24px;
  transition: color 0.3s ease;
}

.close-modal:hover {
  color: var(--text-color);
}

.modal-body {
  padding: 20px;
}

.form-group {
  margin-bottom: 15px;
}

.form-group label {
  display: block;
  font-size: 14px;
  margin-bottom: 5px;
}

.form-group input {
  width: 100%;
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 5px;
  padding: 10px;
  color: var(--text-color);
  font-size: 14px;
  outline: none;
  transition: border-color 0.3s ease;
}

.form-group input:focus {
  border-color: var(--primary-color);
}

.login-submit,
.register-submit {
  width: 100%;
  background-color: var(--primary-color);
  color: var(--text-color);
  padding: 10px;
  border-radius: 5px;
  font-size: 16px;
  transition: background-color 0.3s ease;
}

.login-submit:hover,
.register-submit:hover {
  background-color: var(--hover-color);
}

.social-login {
  margin-top: 20px;
  text-align: center;
}

.social-login p {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 10px;
}

.social-icons {
  display: flex;
  justify-content: center;
  gap: 15px;
}

.social-icons i {
  font-size: 24px;
  transition: color 0.3s ease;
}

.social-icons i:hover {
  color: var(--primary-color);
}

.register-link,
.login-link {
  margin-top: 15px;
  text-align: center;
  font-size: 14px;
}

.register-link a,
.login-link a {
  color: var(--primary-color);
  transition: color 0.3s ease;
}

.register-link a:hover,
.login-link a:hover {
  color: var(--hover-color);
}

video {
  width: 100%;
  height: auto;
  background-color: #000;
  border-radius: 5px;
}

/* 动画效果 */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 悬浮动画 */
.hover-animation {
  position: relative;
  overflow: hidden;
}

.hover-animation::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    to right,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.1) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: rotate(30deg);
  animation: shine 3s infinite linear;
}

@keyframes shine {
  0% {
    transform: translateX(-100%) rotate(30deg);
  }
  100% {
    transform: translateX(100%) rotate(30deg);
  }
}
